import IThreeApp from '../IThreeApp';
import * as THREE from 'three';

class _00Test2 implements IThreeApp {
  private element: HTMLCanvasElement = null;

  public create() {
    this.destory();
    const can = document.createElement('canvas');
    this.element = can;
    // this.element.appendChild
    can.style.backgroundColor = '#00ff00';
    return can;
  }

  public start() {}

  public destory() {
    if (this.element !== null) {
      const content = document.getElementById('content');
      if (content && content.children[0] == this.element) {
        content.removeChild(this.element);
      }
      this.element = null;
    }
  }
}

export default new _00Test2();
